import { Pipe, PipeTransform} from '@angular/core'

@Pipe({
  name: 'd10000'
})

export class FormatValPipe implements PipeTransform {
  transform(val: number, toFixed: number = 2) {
    if (val === undefined || val === null || val.toString() === "") return val;
    return !isNaN(parseFloat(val.toString()))
      ? (parseFloat(val.toString()) / 10000).toFixed(toFixed)
      : val
  }
}